package com.zhengqing.design.action.interpreter._01.expression.impl;

import com.zhengqing.design.action.interpreter._01.Context;
import com.zhengqing.design.action.interpreter._01.expression.Expression;

/**
 * <p> 终结符表达式 </p>
 *
 * @author zhengqingya
 * @description
 * @date 2022/12/22 13:53
 */
public class TerminalExpression implements Expression {
    String variable;

    public TerminalExpression(String variable) {
        this.variable = variable;
    }

    @Override
    public int interpreter(Context context) {
        return context.lookup(this);
    }
}
